package tools

func IsMapNotEmpty[K comparable, V any](tMap map[K]V, isTrue, isFalse func()) bool {
	if len(tMap) == 0 {
		if isFalse != nil {
			isFalse()
		}
		return false
	}
	if isTrue != nil {
		isTrue()
	}
	return true
}
func IsExistKInMap[k comparable, V any](tMap map[k]V, target k) bool {
	if _, ok := tMap[target]; ok {
		return true
	}
	return false
}
func IsExistVInMap[K comparable, V comparable](tMap map[K]V, target V) bool {
	for _, a := range tMap {
		if a == target {
			return true
		}
	}
	return false
}
func IsExistVInArr[K comparable](tMap []K, target K) bool {
	for _, a := range tMap {
		if a == target {
			return true
		}
	}
	return false
}
